<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function value(arr) {
        let max = arr[0];
        let sy = 0;
        for (let i = 0; i < arr.length; i++) {
          if (arr[i] > max) {
            max = arr[i];
          }
          if (arr[i] === max) {
            sy = i;
          }
        }
        console.log(sy);
        return;
      }
      value([1, 3, 6, 5]);
      function value2(num) {
        let arr = [];
        for (let i = 1; i <= num; i++) {
          arr.push(Math.floor(Math.random() * (99 + 1)));
        }
        console.log(arr);
        return;
        // while (arr2.length > 5) {
        //   arr2.push(Math.floor(Math.random() * (99 + 1)));
        //   console.log(arr2);
        //   return;
        // }
      }
      value2(5);
      function value3(a, b) {
        return a < b ? b : a;
      }
      const re = value3(5, 10);
      console.log(re);
      
    </script>
  </body>
</html>
